package com.acsior.hibernate.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * Подръжка на валута
 * 
 * @author Б. Милева 28.03.2012
 */
@Entity
@Table(name = "currency")
@GeneratorKey(tableName = "currency")
public class CurrencyVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = -5259611111552922558L;

	@Column(name = "currency_date", nullable = false, length = 23)
	private Date currencyDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "employee_id", nullable = false)
	private EmployeeVO employee;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "nom_currency_id", nullable = false)
	private NomCurrencyVO nomCurrency;

	@Column(name = "rate", nullable = false, scale = 5)
	private double rate;

	@Column(name = "unit", nullable = false)
	private int unit;

	/** default constructor */
	public CurrencyVO() {
		super();
	}

	/** @return the currencyDate */
	public Date getCurrencyDate() {
		return this.currencyDate;
	}

	/** @return the employee */
	public EmployeeVO getEmployee() {
		return this.employee;
	}

	/** @return the nomCurrency */
	public NomCurrencyVO getNomCurrency() {
		return this.nomCurrency;
	}

	/** @return the rate */
	public double getRate() {
		return this.rate;
	}

	/** @return the unit */
	public int getUnit() {
		return this.unit;
	}

	/**
	 * @param currencyDate
	 *            the currencyDate to set
	 */
	public void setCurrencyDate(Date currencyDate) {
		this.currencyDate = currencyDate;
	}

	/**
	 * @param employee
	 *            the employee to set
	 */
	public void setEmployee(EmployeeVO employee) {
		this.employee = employee;
	}

	/**
	 * @param nomCurrency
	 *            the nomCurrency to set
	 */
	public void setNomCurrency(NomCurrencyVO nomCurrency) {
		this.nomCurrency = nomCurrency;
	}

	/**
	 * @param rate
	 *            the rate to set
	 */
	public void setRate(double rate) {
		this.rate = rate;
	}

	/**
	 * @param unit
	 *            the unit to set
	 */
	public void setUnit(int unit) {
		this.unit = unit;
	}

}
